// 用户表
const {DataTypes, db } = require("../db");
db.define('admin', {
id: {type: DataTypes.INTEGER, primaryKey: true, autoIncrement: true,comment:'表自增ID'},
tenantId:{type: DataTypes.INTEGER,allowNull:false,comment:'租户ID'}, 
username:{type: DataTypes.STRING(128),defaultValue:(''),comment:'用户名称'}, 
userpwd:{type: DataTypes.STRING(128),comment:'密码'}, 
token:{type: DataTypes.STRING(128),comment:'token'}, 
name:{type: DataTypes.STRING(128),allowNull:false,comment:'真实名'}, 
pinYin:{type: DataTypes.STRING(128),defaultValue:(''),comment:'拼音'}, 
mobile:{type: DataTypes.STRING(128),comment:'手机'}, 
roleId:{type: DataTypes.INTEGER,comment:'角色ID'}, 
deptId:{type: DataTypes.INTEGER,comment:'部门ID'}, 
roleName:{type: DataTypes.STRING(50),comment:'角色'}, 
sex:{type: DataTypes.INTEGER,comment:''}, 
avatar:{type: DataTypes.STRING(255),comment:''}, 
printHead:{type: DataTypes.STRING(255),comment:'打印抬头'}, 
disabled:{type: DataTypes.INTEGER,defaultValue:0,comment:'停用0/1/2  2删除'}, 
isDel:{type: DataTypes.INTEGER,defaultValue:0,comment:''}, 
errCount:{type: DataTypes.INTEGER,defaultValue:0,comment:'登录错误次数5次禁止登录'}, 
canDelDeliver:{type: DataTypes.INTEGER,defaultValue:0,comment:'可删除配送票据'}, 
cby:{type: DataTypes.INTEGER,comment:''}, 
ctime:{type: DataTypes.STRING(20),comment:''}, 
uby:{type: DataTypes.INTEGER,defaultValue:0,comment:''}, 
utime:{type: DataTypes.STRING(20),comment:''}, 
dby:{type: DataTypes.INTEGER,comment:''}, 
dtime:{type: DataTypes.STRING(20),comment:''}, 
autoLogin:{type: DataTypes.INTEGER,defaultValue:0,comment:'自动登录0/1'}, 
loginCell:{type: DataTypes.INTEGER,defaultValue:1,comment:'允许手机登录0/1'}, 
loginPc:{type: DataTypes.INTEGER,defaultValue:1,comment:'允许电脑登录0/1'}, 
currentLN:{type: DataTypes.STRING(255),defaultValue:(''),comment:'经纬度'}, 
createdAt:{type: DataTypes.STRING(20),comment:'创建时间'}, 
updatedAt:{type: DataTypes.STRING(20),comment:'更新时间'}, 
deptName:{type: DataTypes.STRING(50),defaultValue:(''),comment:'部门名称'}, 
uuid:{type: DataTypes.STRING(64),comment:''}, 
updating:{type: DataTypes.INTEGER,defaultValue:0,comment:'=1在更新中'}, 
sign:{type: DataTypes.STRING(255),comment:'签名'}, 
allData:{type: DataTypes.INTEGER,defaultValue:0,comment:'所有数据可见'}, 
selfData:{type: DataTypes.INTEGER,defaultValue:1,comment:'可见自己数据'}, 
cellToLogin:{type: DataTypes.INTEGER,defaultValue:1,comment:''}, 
autoLeft:{type: DataTypes.INTEGER,defaultValue:0,comment:'自动离店'}, 
receiptDate:{type: DataTypes.INTEGER,defaultValue:0,comment:'扫单收款时，时间默认填充为业务票据时间'}, 
buId:{type: DataTypes.INTEGER,comment:'关联的客户ID'}, 

}, {
    tableName: 'admin',
    timestamps: false,
    comment: '用户表',
    
});